package example.oauth;

import java.util.List;
import java.util.Map;

public class OAuthMessage {
    public static final String GET = "GET";
    public static final String POST = "POST";
     
    public String method;
    public String URL;
    
    private final List<Map.Entry<String, String>> parameters;
    
    public OAuthMessage(List<Map.Entry<String, String>> parameters){
    	this.parameters = parameters;
    }
    
    
    //public newRequest
    
    @Override
    public String toString() {
        return "OAuthMessage(" + method + ", " + URL + ", " + parameters + ")";
    }
    
    //private Map<String, String> parameterMap;
    

    /*public void addParameter(String key, String value) {
        addParameter(new OAuth.Parameter(key, value));
    }

    public void addParameter(Map.Entry<String, String> parameter) {
        parameters.add(parameter);
        parameterMap = null;
    }
    
	public String getParameter(String name) throws IOException {
        return getParameterMap().get(name);
    }
    public String getConsumerKey() throws IOException {
        return getParameter(OAuth.OAUTH_CONSUMER_KEY);
    }

    public String getToken() throws IOException {
        return getParameter(OAuth.OAUTH_TOKEN);
    }

    public String getSignatureMethod() throws IOException {
        return getParameter(OAuth.OAUTH_SIGNATURE_METHOD);
    }

    public String getSignature() throws IOException {
        return getParameter(OAuth.OAUTH_SIGNATURE);
    }
    
    public void addParameters(Collection<? extends Map.Entry<String, String>> parameters) {
        this.parameters.addAll(parameters);
        parameterMap = null;
    }
    
    protected Map<String, String> getParameterMap() throws IOException {
        //beforeGetParameter();
        if (parameterMap == null) {
            //parameterMap = OAuth.newMap(parameters);
        }
        return parameterMap;
    }*/
    
    /** A caller is about to get a parameter. */
   /* private void beforeGetParameter() throws IOException {
        if (!parametersAreComplete) {
            completeParameters();
            parametersAreComplete = true;
        }
    }*/
}
